//
//  HomeTitleButton.swift
//  WEIBO_SWIFT
//
//  Created by 岳挺 on 15/6/30.
//  Copyright © 2015年 yueting. All rights reserved.
//

import UIKit

class HomeTitleButton: UIButton {
    
    class func titleBtnWithTitle (title : String) -> HomeTitleButton{
        let btn = HomeTitleButton()
        btn.setTitle(title + " ", forState: UIControlState.Normal)
        btn.setTitleColor(UIColor.blackColor(), forState: UIControlState.Normal)
        btn.setImage(UIImage(named: "navigationbar_arrow_up"), forState: UIControlState.Normal)
        btn.setImage(UIImage(named: "navigationbar_arrow_down"), forState: UIControlState.Selected)
        btn.adjustsImageWhenHighlighted = false
        btn.sizeToFit()
        return btn
    }

    override func layoutSubviews() {
        super.layoutSubviews()
        titleLabel!.frame.origin.x = 0
        imageView!.frame.origin.x = titleLabel!.bounds.width
    }
}
